table! {
    codes (id) {
        id -> Int4,
        uid -> Int4,
        class -> Varchar,
        name -> Varchar,
        cover -> Nullable<Varchar>,
        content -> Varchar,
        remark -> Nullable<Varchar>,
        created_at -> Nullable<Timestamp>,
        updated_at -> Nullable<Timestamp>,
    }
}

table! {
    course_types (id) {
        id -> Int4,
        name -> Varchar,
        remark -> Nullable<Varchar>,
        created_at -> Nullable<Timestamp>,
        updated_at -> Nullable<Timestamp>,
    }
}

table! {
    courses (id) {
        id -> Int4,
        tid -> Int4,
        name -> Varchar,
        sort -> Nullable<Int4>,
        remark -> Nullable<Varchar>,
        created_at -> Nullable<Timestamp>,
        updated_at -> Nullable<Timestamp>,
    }
}

table! {
    resources (id) {
        id -> Int4,
        cid -> Int4,
        class -> Varchar,
        name -> Varchar,
        content -> Varchar,
        sort -> Nullable<Int4>,
        remark -> Nullable<Varchar>,
        created_at -> Nullable<Timestamp>,
        updated_at -> Nullable<Timestamp>,
    }
}

table! {
    school_courses (id) {
        id -> Int4,
        sid -> Int4,
        cid -> Int4,
        created_at -> Nullable<Timestamp>,
        updated_at -> Nullable<Timestamp>,
    }
}

table! {
    schools (id) {
        id -> Int4,
        name -> Varchar,
        domain -> Varchar,
        logo -> Varchar,
        images -> Nullable<Varchar>,
        expired_at -> Nullable<Timestamp>,
        created_at -> Nullable<Timestamp>,
        updated_at -> Nullable<Timestamp>,
    }
}

table! {
    user_infos (id) {
        id -> Int4,
        uid -> Int4,
        sex -> Nullable<Varchar>,
        address -> Nullable<Varchar>,
        school -> Nullable<Varchar>,
        remark -> Nullable<Varchar>,
    }
}

table! {
    users (id) {
        id -> Int4,
        sid -> Int4,
        username -> Varchar,
        phone -> Varchar,
        password -> Varchar,
        role -> Nullable<Varchar>,
        created_at -> Nullable<Timestamp>,
        updated_at -> Nullable<Timestamp>,
    }
}

joinable!(codes -> users (uid));
joinable!(courses -> course_types (tid));
joinable!(resources -> courses (cid));
joinable!(school_courses -> courses (cid));
joinable!(school_courses -> schools (sid));
joinable!(user_infos -> users (uid));
joinable!(users -> schools (sid));

allow_tables_to_appear_in_same_query!(
    codes,
    course_types,
    courses,
    resources,
    school_courses,
    schools,
    user_infos,
    users,
);
